package com.by.wx.exc.handler;

import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * 全局异常-处理层
 * @ClassName GexHandler
 * @Date 2025/1/2
 * @Author Blue
 */
@Slf4j
@RestControllerAdvice
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class GexHandler {

    /**
     * 任何异常处理
     */
    @ExceptionHandler
    public String handlerException(Exception e) {
        e.printStackTrace();
        log.error("任何异常处理:{}", e.getClass());
        return "error";
    }

}